package com.cmrx.model.util;

import com.cmrx.model.vo.IRespCode;
import com.cmrx.model.vo.ResultVo;

public class ResultVoUtil {
    public static <T> ResultVo success(T t){
        ResultVo result = new ResultVo();
        result.setCode(IRespCode.SUCCESS_CODE);
        result.setData(t);
        result.setMessage("请求成功");
        return  result;
    }
    public static  ResultVo message(String message){
        ResultVo result = new ResultVo();
        result.setCode(IRespCode.SUCCESS_CODE);
        result.setMessage(message);
        return  result;
    }

    public static ResultVo error(Integer code, String msg) {
        ResultVo resultVO = new ResultVo();
        resultVO.setCode(code);
        resultVO.setMessage(msg);
        return resultVO;
    }


}
